/**
 * 
 */
package com.car.mng;

import java.sql.CallableStatement;
import java.util.HashMap;
import java.util.List;
import com.data.mng.Dao;
import com.opensymphony.xwork2.Action;

/**
 * @author Administrator
 *
 */
public class CarMng implements Action {
	private List<HashMap<String, Object>> carInfo = null;
	
	/**
	 * @return the carInfo
	 */
	public List<HashMap<String, Object>> getCarInfo() {
		return carInfo;
	}

	/**
	 * @param carInfo the carInfo to set
	 */
	public void setCarInfo(List<HashMap<String, Object>> carInfo) {
		this.carInfo = carInfo;
	}

	public String execute()throws Exception{
		Dao d = new Dao();
		CallableStatement c = d.getCallableStatement("Call proc_getGoodsInfo(?,?,false,null,false,null,false,null,false,null,false,null,false,null,false,null,false,null,false,null,false,null,false,null)");
		c.setBoolean("p_mode1", true);
		c.setString("p_GoodsStyle", "1212");
		List<HashMap<String, Object>> ret = d.execQuery(c);
		if (ret.size() < 1) {
			// user not exist
			return "failed";
		} else if (ret.size() > 0) {
			carInfo = ret;
			return "success";
		} else {
			return "failed";
		}
	}
}
